﻿@model ArivisTests.Models.TestPlan
@using ArivisTests.Views;

@{
    ViewBag.Title = "Edit";
}

@section Navigation{
    @Html.ActionLink("Test Plans", "Index") &rsaquo; @Html.DisplayFor(model => model.Name)
}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>TestPlan</legend>

        @Html.HiddenFor(model => model.Id)

        <table class="editor-table">
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Name)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Tests)
                </td>
                <td class="editor-field">
                    @using (var context = new ArivisTests.Models.ArivisTestsDBContext())
                    {
                        @Html.CheckboxList("scenarios", context.TestScenarios, s => Model.Tests.Any(x => x.Id == s.Id));
                    }
                    @Html.ValidationMessageFor(model => model.Tests)
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
